﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Drawing;
using NHTU;
using System.Threading;
using NOMFinalSettlement.AppForm;

namespace NOMFinalSettlement
{
    static class Program
    {
        public static SplashScreen splash;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            /*****************************************
			 * Setup and display splash screen
			 *************************************** */
            var InfoLabel = new Point(400, 310); // Creates the point to position the ProgramInfoLabel
            var StatusLabel = new Point(200, 200); // Creates the point to position the StatusLabel

            splash = SplashScreen.Current; // 
            splash.SetBackgroundImage = new Bitmap(Properties.Resources.splash);

            splash.SetFade = true;

            splash.SetStatusLabel(StatusLabel, 300, 20);
            splash.SetInfoLabel(InfoLabel, 300, 20);
            splash.ShowSplashScreen();

            splash.SetInfo = "http://www.nom.vn";

            splash.SetStatus = "Khởi động hệ thống ...";
            Thread.Sleep(3000);

            // Create and AssemblyHandler
            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.AssemblyLoad += asmLoadHandler;

            /*************** end setup splash ******************/

            Application.Run(new MainApp());
        }

        static void asmLoadHandler(object sender, AssemblyLoadEventArgs args)
        {
            splash.SetStatus = "Đang tải: " + args.LoadedAssembly.GetName().Name + " ...";
            Thread.Sleep(1000);
        }
    }


}
